from django.db import models
from op_drf.base import BaseModel

# Create your models here.
class TabletInfo(models.Model):
    '''
    药品信息，是否考虑用同一个编码
    '''
    tblt_cd = models.CharField(max_length=50,verbose_name="药品编号",help_text="药品编号",null=False)
    tblt_ex_cd = models.CharField(max_length=100,verbose_name="",null=True)
    tblt_nm = models.CharField(max_length=100,null=False,default="",verbose_name="药品名称")
    tblt_contents = models.CharField(max_length=100,null=False,default="")
    tblt_short_nm = models.CharField(max_length=100,null=False,default="")
    tblt_barcode = models.CharField(max_length=100,null=True)
    sell_by_date = models.CharField(max_length=8,null=True)
    tblt_price = models.FloatField(null=True)
    tblt_lot_num = models.CharField(max_length=30,null=True)
    tblt_volumn = models.FloatField(null=True)
    tblt_diameter = models.FloatField(null=True)
    tblt_maker = models.CharField(max_length=100,null=True)
    tblt_type = models.CharField(max_length=100,null=True)
    tblt_weight = models.FloatField(null=True)
    use_yn = models.CharField(max_length=2,null=True,default="Y")
    updt_dtm = models.CharField(max_length=14,null=True)
    updt_user_id = models.CharField(max_length=20,null=True)
    take_time_cd = models.CharField(max_length=10,null=True)
    tblt_unit = models.CharField(max_length=50,null=True)
    use_atm_yn = models.CharField(max_length=1,null=False,default="Y")
    reserved1 = models.CharField(max_length=100,null=True)
    reserved2 = models.CharField(max_length=100,null=True)
    reserved3 = models.CharField(max_length=100,null=True)
    reserved4 = models.CharField(max_length=100,null=True)
    reserved5 = models.CharField(max_length=100,null=True)
    tblt_clsf = models.CharField(max_length=10,null=True)
    tblt_shape = models.CharField(max_length=50,null=True)
    tblt_color = models.CharField(max_length=50,null=True)
    fsp_level = models.CharField(max_length=10,null=True)
    tblt_spec = models.CharField(max_length=50,null=True)
    use_fsp_yn = models.CharField(max_length=1,null=False,default="Y")
    ppf_cd = models.CharField(max_length=10,null=True)
    fsp_tblt_clsf = models.CharField(max_length=10,null=True)
    tblt_generic_nm = models.CharField(max_length=100,null=True)
    hspt_tblt_lot_num = models.CharField(max_length=30,null=True)
    hspt_tblt_exp_date = models.CharField(max_length=8,null=True)
    package_size = models.IntegerField(null=True)
    take_tp_cd = models.CharField(max_length=10,null=True)
    tblt_size_factor = models.FloatField(null=False,default=1)
    tblt_barcode_list = models.CharField(max_length=250,null=True)
    tblt_std_cd = models.CharField(max_length=50,null=True)
    tblt_nm_abbr = models.CharField(max_length=50,null=True)
    tblt_brand_nm_abbr = models.CharField(max_length=50,null=True)
    tblt_generic_nm_abbr = models.CharField(max_length=50,null=True)
    tblt_inprint = models.CharField(max_length=50,null=True)
    divide_package_yn = models.CharField(max_length=1,default="N")
    tblt_store_location = models.CharField(max_length=100,null=True)
    tblt_exp_date = models.CharField(max_length=8,null=True)
    max_dose = models.CharField(max_length=100,null=True)
    tblt_group = models.CharField(max_length=20,null=True)
    stat_elec_yn = models.CharField(max_length=1,null=True)

    class Meta:
        db_table = "xyx_tabletinfo"
        verbose_name = "药品信息"
        verbose_name_plural = verbose_name